package com.tapadoo.alerter;

import android.app.Activity;

import com.tapadoo.android.R;


/**
 * Toast统一管理类
 */
public class AlerterUtils {
    public static void alerter(Activity activity, String msg) {
        alerter(activity,msg,false);
    }

    public static void alerter(Activity activity, String msg, boolean isPositive) {
        Alerter.create(activity)
                .setText(msg)
                .setDuration(500)
                .enableSwipeToDismiss()
                .setTextAppearance(R.style.AlertTextAppearance_Text)
                .setBackgroundColorRes(isPositive ? R.color.toast_green : R.color.toast_red)
                .show();
    }

}
